import http from "@/utils/http";
import config from "@/views/order/InforEntryPPM/config.js";
export default {
	data() {
		return {
			formData: {},
			pageData: [],
			ppmParams: {},
		};
	},
	async created() {
		
		let ppmParams = JSON.parse(sessionStorage.getItem("ppmCondition"));
		this.ppmParams = ppmParams;
		// 进入页面开始加载PPM配置
		await this.loadPPMConfig(this.ppmParams);
	},
	methods: {
		/**
		 * 加载PPM配置
		 */
		async loadPPMConfig(ppmParams) {
			this.pageData = {};
			this.formData = {};
			let res = await this.qryPageTempAttr(ppmParams);
			if (res.meta.resCode == '0') {
				this.pageData = res.meta.resList.pageModel;
				this.formData = res.meta.resList.paramModel;
			}
		},

		/**
		 * 获取PPM配置数据接口
		 * "productId": "80007009","serviceOfferId": "4040100098","modType": "50200002","optionId": "310"
		 * 新装时的后三个参数是这样的,其它业务会有变化
		 * @param {}
		 * @returns
		 */
		async qryPageTempAttr(condition) {
			let res = await http({
				url: `${process.env.VUE_APP_CTX_PPM_QUERY}/ppm-query-server/qryPageTempAttr`,
				data: condition,
				method: "POST",
			});
			return res;
		},
	},
};
